﻿--添加岗位类别
CREATE proc [dbo].[proc_Post_Category_Create]
	(
		@ParentId int,
		@title nvarchar(50),
		@Sort int
	)
as
declare @number varchar(5)
declare @tempNumber varchar(5)
if((select count(id) from post_category )=0)
	set @number = '01'
else
	begin
		set @tempNumber = (select top 1 number from post_category  order by id desc)
		set @number = @tempNumber + 1
		if (len(@number)=1)
			set @number = '0' + @number
	end
	insert into Post_Category(ParentId,title,Sort,uptime,Number)values(@ParentId,@title,@Sort,getdate(),@Number)